package com.itheima.dubbo.service;

import com.itheima.dubbo.User;
import com.itheima.dubbo.UserInterface;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.config.annotation.Method;
import org.apache.dubbo.rpc.RpcContext;

//@DubboService(timeout=3000)
//@DubboService(methods = {
//        @Method(name="hello ",timeout = 9000)
//})
//@DubboService(retries =0)
@DubboService(version = "1.0.0")
public class UserServiceImpl  implements UserInterface {
    @Override
    public String hello(String username) {
        System.out.println("UserServiceImpl.......");
        RpcContext.getContext().getAttachment("jwt");
//        try {
//            Thread.sleep(2000L);
//        }catch (InterruptedException e){
//            e.printStackTrace();
//
//        }

        return "hello Dubbo username"+username;
    }

    @Override
    public User findUser(User userVO) {
        User user = new User();
        user.setName(userVO.getName());

        return user;
    }



}
